﻿import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_scaffold/getx_scaffold.dart';
import 'career_logic.dart';

/// 职业编辑页面
class CareerView extends GetView<CareerLogic> {
  const CareerView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFF282528),
      appBar: AppBar(
        backgroundColor: const Color(0xFF282528),
        elevation: 0,
        leading: GestureDetector(
          onTap: () => Get.back(),
          child: const Icon(
            Icons.arrow_back_ios,
            color: Colors.white,
            size: 20,
          ),
        ),
        title: const Text(
          '职业',
          style: TextStyle(
            color: Colors.white,
            fontSize: 18,
            fontWeight: FontWeight.w500,
          ),
        ),
        centerTitle: true,
        actions: [
          TextButton(
            onPressed: () => controller.save(),
            child: const Text(
              '保存',
              style: TextStyle(color: Color(0xFF007AFF), fontSize: 16),
            ),
          ),
        ],
      ),
      body: Padding(
        padding: EdgeInsets.all(24.w),
        child: Container(
          padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 12.h),
          decoration: BoxDecoration(
            color: const Color(0xFF2A2A2A),
            borderRadius: BorderRadius.circular(28.r),
          ),
          child: TextField(
            controller: controller.textController,
            style: const TextStyle(color: Colors.white, fontSize: 16),
            decoration: const InputDecoration(
              hintText: '请输入职业',
              hintStyle: TextStyle(color: Color(0xFF666666)),
              border: InputBorder.none,
            ),
            maxLength: 20,
          ),
        ),
      ),
    );
  }
}
